home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / aexpand.pxl < prev    next >
Text File  |  2000-12-23  |  4KB  |  166 lines

  1. {    Filename    :     aexpand.pxl
  2.      Purpose    :    <purpose>
  3.     Date        :    February 20, 2000
  4.     Author        :    <author name (optional: company)>
  5. History:
  6.  
  7.     Version    :  4.40    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "PiXCL Application Title"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,617,107,1019,320,Res)                
  24.     UseBackground(TRANSPARENT,255,255,255)     
  25.     WinShow(Title$,NOTOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     {DragAcceptFile(ENABLE,AcceptFile)}
  30.     AutoProgressBar(DISABLE)
  31.  
  32.     InfoMenu(REMOVE)
  33.     WaitInput(100)
  34.     SetMenu("&File",IGNORE,
  35.         "&New",CreatingFile,
  36.         "&Open",OpeningFile,
  37.         "&Save",SavingFile,
  38.         SEPARATOR,
  39.         "E&xit!",Terminate,
  40.         ENDPOPUP,
  41.         "&View",IGNORE,
  42.         "&ToolBar",ViewToolBar,
  43.         "&StatusBar",ViewStatusBar,
  44.         ENDPOPUP,
  45.         "&Information",IGNORE,
  46.         "&Concept",Concept,
  47.         "&Help",ShowAppHelp,
  48.         SEPARATOR,
  49.         "&About",About,
  50.         ENDPOPUP)
  51.  
  52.     GoSub MakeToolbar
  53.     ChangeMenuItem("&ToolBar",CHECK,TBRes)
  54.  
  55.         
  56.     StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  57.     DrawStatusWinText(0,"Ready")
  58.     ChangeMenuItem("&StatusBar",CHECK,SBRes)
  59.  
  60.     
  61. Wait_for_Input:
  62.     WaitInput()
  63.  
  64. Terminate:
  65.     End
  66.  
  67.  
  68. Concept:
  69.     MessageBox(OK,1,INFORMATION,
  70. "This is a skeleton of a PiXCL application.  You could briefly
  71. describe your application's function here, or provide some
  72. basic help information.",
  73.     "PiXCL Skeleton Concept",Res)
  74.  
  75.     Goto Wait_for_Input
  76.  
  77. ShowAppHelp:
  78.     {An application Help file usually has the same name as the application.}
  79.     Winhelp("aexpand.hlp",CONTENTS,"")
  80.  
  81.     Goto Wait_for_Input
  82.  
  83. About:
  84.     AboutUser("PiXCL Application Title",  { or substitute Title$}
  85.       "Two lines of text goes here e.g. Application function.",
  86.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  87.  
  88.     Goto Wait_for_Input
  89.  
  90. ViewToolBar:
  91.     GetMenuStatus("&ToolBar",CHECKED,Res)
  92.     If Res = 0
  93.         GoSub MakeToolbar
  94.         ChangeMenuItem("&ToolBar",CHECK,Res)
  95.     Else
  96.         Toolbar()
  97.         ChangeMenuItem("&ToolBar",UNCHECK,Res)
  98.     Endif
  99.     Goto Wait_for_Input
  100.  
  101. ViewStatusBar:
  102.     GetMenuStatus("&StatusBar",CHECKED, Res)
  103.     If Res = 0
  104.         StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  105.         DrawStatusWinText(0,"Ready")
  106.         ChangeMenuItem("&StatusBar",CHECK,Res)
  107.     Else
  108.         StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
  109.        ChangeMenuItem("&StatusBar",UNCHECK,Res)
  110.     Endif
  111.     Goto Wait_for_Input
  112.  
  113. CreatingFile:
  114.     WaitInput(1)
  115.     SourceFile$ = SourceDir$ + "\1iddnext.bm_"
  116.     FileGetExpandedName(SourceFile$,DestFile$)
  117.     DebugMsgBox(DestFile$)    
  118.  
  119.  
  120.  
  121.     Goto Wait_for_Input
  122.  
  123. OpeningFile:
  124.     WaitInput(1)
  125.     SourceFile$ = SourceDir$ + "\1iddnext.bm_"
  126.     DestFile$ = SourceDir$ + "\3iddnext.bmp"
  127.     FileLZExpand(SourceFile$,DestFile$,Res)
  128.     DebugMsgBox(Res)
  129.  
  130.     Goto Wait_for_Input
  131.  
  132. SavingFile:
  133.     WaitInput(1)
  134.     DestFile$ = SourceDir$ + "\3iddnext.bmp"
  135.     FileEncrypt(DestFile$,Res) DebugMsgBox(Res)
  136.     FileDecrypt(DestFile$,Res) DebugMsgBox(Res)
  137.     Goto Wait_for_Input
  138.  
  139.  
  140. PrintingFile:
  141.     WaitInput(1)
  142.     {TODO: add file handling here}
  143.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  144.                     "Printing File",Res)
  145.     Goto Wait_for_Input
  146.  
  147. AcceptFile:
  148.     GetDragList(FileList$)
  149.     {TODO: add file list handling here, or delete this whole label handler}
  150.     Goto Wait_for_Input
  151.     
  152. {--- Style Suggestion: place all subroutines at the end of the script.}
  153.  
  154. MakeToolbar: {subroutine}
  155.     Toolbar(    RAISED, PXL_LARGE,
  156.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  157.         PXL_NEW, ENABLED, STD, "Expanded Name", CreatingFile,
  158.         PXL_OPEN, ENABLED, STD, "Expand File", OpeningFile, 
  159.         PXL_SAVE, ENABLED, STD, "FileSave", SavingFile, 
  160.         PXL_PRINT,  ENABLED, STD,"PrintFile", PrintingFile, 
  161.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  162.         HELPINFO, ENABLED, STD,"Show Help",ShowAppHelp) 
  163.  
  164.     Return
  165.  
  166.